import {baseUrl} from '@/config/env';

export default () => {
    return {
        index: true,
        submitText: '修改',
        size: 'small',
        labelWidth: 120,
        indexLabel: '序号',
        dialogType: 'drawer',
        menuAlign: 'center',
        menuPosition: "right",
        menuType: "menu",
        dialogClickModal: false,
        permissionBtn: {
            addBtn: 'codeGenerator:DataTable:add',
            editBtn: 'codeGenerator:DataTable:edit',
            viewBtn: 'codeGenerator:DataTable:info',
            delBtn: 'codeGenerator:DataTable:delete'
        },
        addBtn: false,
        searchIndex: 1,
        searchIcon: true,
        column: [
            {
                label: '数据源',
                span: 12,
                prop: 'dataSourcesKey',
                type: 'select',
                search: true,
                addDisplay: false,
                editDisplay: false,
                showColumn: false,
                searchSpan: 6,
                searchValue: 'master',
                dicUrl: baseUrl + "/code-generator/dataSource/list",
                dicMethod: "get",
                props: {
                    label: 'name',
                    value: 'keyFlag',
                },
            },

            {
                label: '数据库名称',
                span: 24,
                prop: 'tableSchema',
                width: 160,
                addDisplay: false,
                editDisplay: false
            },
            {
                label: '引擎名称',
                span: 12,
                width: 160,
                prop: 'engineName',
                addDisplay: false,
                editDisplay: false,
                showColumn: false,
            },
            {
                label: '数据表名',
                span: 12,
                prop: 'tableName',
                width: 200,
                search: true,
                searchSpan: 6,
                rules: [{
                    required: true,
                    trigger: "blur"
                }]
            },
            {
                label: '数据表中文名称',
                span: 12,
                prop: 'tableComment',
                search: true,
                searchSpan: 6,
                searchLabelWidth: 120,
            },

            {
                label: '字符集',
                span: 12,
                prop: 'tableCollation',
                addDisplay: false,
                editDisplay: false,
            },
            {
                label: '创建时间',
                prop: 'createTime',
                type: 'datetime',
                addDisplay: false,
                editDisplay: false
            },
        ]
    }
}
